<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:composition template="layout.xhtml">
        
        <ui:define name="title">
           Pesquisar Emolumentos
           
        </ui:define>

        
        <ui:define name="content">           
            <h:form id="pesquisarEmolumentoForm">
                <div class="actions">
                    <div id="buttons">
                        <p:button value="Cadastrar Emolumento" outcome="criarEmolumento.xhtml"
                                  icon="ui-icon-plus" styleClass="ui-priority-primary">
                        </p:button>
                    </div>
                </div> 

                     <p:fieldset legend="Filtros" id="dadosFieldset">
                    <f:validateBean disabled="true">
                        <div class="row">
                            <div class="column2">
                                <p:outputLabel value="Descrição" for="descricaoInputText" />
                            </div>
                            <div class="column4">
                                <p:inputText id="descricaoInputText" value="#{ managerPesquisarEmolumento.emolumentoPesquisar.descricao }" />
                            </div>
                            
                            <div class="column2">
                                <p:outputLabel value="Data de Vigor" for="dataVigorCalendar" />
                            </div>
                            <div class="column3">
                                <p:calendar id="dataVigorCalendar" value="#{ managerPesquisarEmolumento.emolumentoPesquisar.dataVigor }" showOn="button"
                                    pattern="dd/MM/yyyy" locale="pt" />
                            </div>
                        </div>
                        
                    </f:validateBean>
                     </p:fieldset>

                    
                <div class="command">
                    <p:commandButton
                        id="pesquisarcommandButton" value="Pesquisar" icon="ui-icon-search" oncomplete="widthFix();"
                        update="@form" styleClass="ui-priority-primary" actionListener="#{ managerPesquisarEmolumento.pesquisar() }" />
                    <p:commandButton value="Limpar" icon="ui-icon-close" update="@form" actionListener="#{ managerPesquisarEmolumento.limpar() }" />
                </div>
                    
                <p:dataTable id="tiposSeloDataTable" var="emolumento" value="#{ managerPesquisarEmolumento.emolumentos }"
                    rows="10" paginator="true" paginatorPosition="bottom" emptyMessage="Nenhum registro encontrado">

                    <p:column width="5%" headerText="Opções">
                        <div class="options1">

                            <p:button
                                title="Visualizar" href="visualizarEmolumento.xhtml?emolumentoId=#{ emolumento.id }"
                                icon="ui-icon-search"/>
                        </div>
                    </p:column>
                    
                    <p:column headerText="Descrição" width="50%">

                        <h:outputText value="#{ emolumento.descricao }" />
                    </p:column>
                    <p:column headerText="Ativo" width="10%">
                        <h:outputText value="#{ emolumento.ativo == true ? 'Ativo' : 'Inativo' }" />
                    </p:column>                        
                    <p:column headerText="Data de Vigor" width="20%">
                        <h:outputText value="#{ emolumento.dataVigor }">
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>
                    </p:column>
                    <p:column headerText="Valor do Selo" width="10%">
                        <h:outputText value="#{ emolumento.valorSelo }">
                            <f:convertNumber type="currency" locale="pt-BR" />
                        </h:outputText>
                    </p:column>
                </p:dataTable>                    

            </h:form>
        </ui:define>
    </ui:composition>
    
</html>